package com.nbsaas.boot;

import com.nbsaas.boot.rest.response.ResponseObject;

import java.util.Arrays;
import java.util.List;

public class OcrApp {

    public static void main(String[] args) {
        // 创建OCR+AI服务实例
        OcrAiService service = new OcrAiService();

        try {
            // 初始化服务
            service.initialize();

            // 测试图片URL
            String imageUrl = "https://baisonscm.oss-cn-beijing.aliyuncs.com/scm/files/aa.png";

            // 执行OCR识别和AI纠错
            ResponseObject<CallInfo> result = service.processImage(imageUrl);
            System.out.println("最终结果: " + result);

            // 批量处理示例
            List<String> imageUrls = Arrays.asList(
                    "https://baisonscm.oss-cn-beijing.aliyuncs.com/scm/files/aa.png",
                    "https://baisonscm.oss-cn-beijing.aliyuncs.com/scm/files/aa.png"
            );

            List<CallInfo> batchResults = service.batchProcessImages(imageUrls);
            System.out.println("批量处理结果: " + batchResults);

        } finally {
            // 关闭服务
            service.shutdown();
        }
    }
}